Skip to main content

Near Real-Time People Count

Background

peopleCountStream is a Poly Lens GraphQL Subscription API that provides a near real-time count of the people present in a conference room. This simple, yet powerful API is designed to show live room occupancy, which can be used in a variety of different use cases. Some examples include automated room booking or releasing, adjusting lighting or room temperature, or visualizing live room occupancy.

Arguments

The peopleCountStream API needs the following arguments. The values are case sensitive.

ArgumentDescriptionType
tenantIdUnique identifier of your Poly Lens TenantID!
roomIdsUnique identifier(s) of the room(s) to be monitored for change in people count; Array type argument; Accepts multiple room IDs to monitor[ID!]!

Fields

The peopleCountStream subscription returns the following fields.

FieldDescriptionType
countUpdated count of people in the roomInt!
roomIdUnique identifier of the room for which updated people count is being returnedID!
tenantIdUnique identifier of your Poly Lens TenantID!
updatedAtThe date and time when updated people count is returnedDateTime!

peopleCountStream Subscription in the Poly Lens GraphQL Playground

Let’s say there are two rooms in your Poly Lens tenant that you want to monitor for people count. You can use the following peopleCountStream subscription.

Test this subscription in the GraphQL Playground

subscription PeopleCountStream($tenantId: ID!, $roomIds: [ID!]!) {
peopleCountStream(tenantId: $tenantId, roomIds: $roomIds) {
count
updatedAt
roomId
tenantId
__typename
}
}

Arguments passed for the above subscription

{
"tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx55f9",
"roomIds": [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx8497",
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx34e4"
]
}

A snapshot of the response for the above query

// Response received at 23:20:11
{
"data": {
"peopleCountStream": {
"count": 1,
"updatedAt": "2023-11-17T17:44:00.000Z",
"roomId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx8497",
"tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx55f9",
"__typename": "PeopleCount"
}
}
}

// Response received at 23:20:11
{
"data": {
"peopleCountStream": {
"count": 0,
"updatedAt": "2023-11-17T17:46:00.000Z",
"roomId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx34e4",
"tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx55f9",
"__typename": "PeopleCount"
}
}
}
  • count returns the updated number of people in the room.
  • updatedAt provides the timestamp for when the people count changed.
  • The timestamp format is according to the ISO 8601 standard.

Important Notes

Supported Devices:

  • Poly Studio X30
  • Poly Studio X50
  • Poly Studio X52
  • Poly Studio X70
  • Poly G7500 with Studio E70

Required Subscription:

  • Poly Lens Premium

Summary

The peopleCountStream subscription API is just a small example of the power of the Poly Lens GraphQL Subscription APIs. We'll be updating this page with more examples over time. Please reach out if you have specific content requests or questions.